﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

public class ServiceDetail
{
    #region "variable"
    private int id_SD;    
    private int id_ST;    
    private string _packageName;
    private int _durationDate;
    private int _durationTime;
    private string _description;
    private int _discount;
    private float _denomination;
    private float _total;
    private bool _status;

    
    #endregion

    #region "Properties"
    public bool Status
    {
        get { return _status; }
        set { _status = value; }
    }
    public int Id_ST
    {
        get { return id_ST; }
        set { id_ST = value; }
    }
    public int Id_SD
    {
        get { return id_SD; }
        set { id_SD = value; }
    }
    public float Total
    {
        get { return _total; }
        set { _total = value; }
    }
    public float Denomination
    {
        get { return _denomination; }
        set { _denomination = value; }
    }
    public int Discount
    {
        get { return _discount; }
        set { _discount = value; }
    }
    public string Description
    {
        get { return _description; }
        set { _description = value; }
    }
    public int DurationTime
    {
        get { return _durationTime; }
        set { _durationTime = value; }
    }
    public int DurationDate
    {
        get { return _durationDate; }
        set { _durationDate = value; }
    }
    public string PackageName
    {
        get { return _packageName; }
        set { _packageName = value; }
    }
    #endregion
    public ServiceDetail()
    {

    }
    public ServiceDetail(DataRow row)
    {        
        this.id_SD=(int)row["id_SD"];
        this.id_ST = (int)row["id_ST"];
        if (row["_packageName"]==DBNull.Value)
        {
            this._packageName = "";
        }
        else this._packageName=(string)row["_packageName"];
        if (row["_total"]==DBNull.Value)
        {
            this._total = 0;
        }
        else this._total = float.Parse(row["_total"].ToString());
        if (row["_durationTime"]==DBNull.Value)
        {
            this._durationTime = 0;
        }
        else this._durationTime = (int)row["_durationTime"];
        if (row["_durationDate"]==DBNull.Value)
        {
            this._durationDate = 0;
        }
        else this._durationDate=(int)row["_durationDate"];
        if (row["_discount"]==DBNull.Value)
        {
            this._discount = 0;
        }
        else this._discount=(int)row["_discount"];
        if (row["_description"]==DBNull.Value)
        {
            this._description = "";
        }
        else this._description=(string)row["_description"];
        if (row["_denomination"]==DBNull.Value)
        {
            this._denomination = 0;
        }
        else this._denomination = float.Parse(row["_denomination"].ToString());
        this._status = bool.Parse(row["_status"].ToString());
    }
    public ServiceDetail(int id_ST, string _packageName, int _durationDate, int _durationTime, string _description, int _discount, float _denomination, float _total)
    {
        this.id_ST = id_ST;
        this._denomination = _denomination;
        this._description = _description;
        this._discount = _discount;
        this._durationDate = _durationDate;
        this._durationTime = _durationTime;
        this._packageName = _packageName;
        this._total = _total;        
    }
    public ServiceDetail( string _packageName, int _durationDate, int _durationTime, string _description, int _discount, float _denomination, float _total,int id_SD)
    {
        this.id_SD = id_SD;
        this._denomination = _denomination;
        this._description = _description;
        this._discount = _discount;
        this._durationDate = _durationDate;
        this._durationTime = _durationTime;
        this._packageName = _packageName;
        this._total = _total;
    }
    public ServiceDetail(int id_ST, string _packageName, int _durationDate, int _durationTime, string _description, int _discount, float _denomination, float _total,bool _status)
    {
        this.id_ST = id_ST;
        this._denomination = _denomination;
        this._description = _description;
        this._discount = _discount;
        this._durationDate = _durationDate;
        this._durationTime = _durationTime;
        this._packageName = _packageName;
        this._total = _total;
        this._status = _status;
    }
}
